﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using NNFramework.NeuroLibrary;

namespace CustomWPFControls
{
    /// <summary>
    /// Interaction logic for UserControl1.xaml
    /// </summary>
    public partial class NeuronViewer : UserControl
    {
        private clsNeuron<int, int> mclnNeuron;
        public clsNeuron<int, int> Neuron
        {
            get
            {
                return mclnNeuron;
            }
            set
            {
                if (value != mclnNeuron && value != null)
                {
                    mclnNeuron = value;
                    DrawNeuron();
                }
            }
        }
        
        public NeuronViewer()
        {
            InitializeComponent();
        }

        public void DrawNeuron()
        {
            lblFunctionName.Content = mclnNeuron.ActivationFunction;
            lblAxonValue.Content = mclnNeuron.Axon;
            lblNeuronType.Content = mclnNeuron.GetType().Name;
            if (mclnNeuron.DendritesCount > 4)
            {
                lblWarning.Visibility = Visibility.Visible;
                
                //lblD1.Content = (mclnNeuron.Dendrites.ToList())[0].
            }
            else
            {
                lblWarning.Visibility = Visibility.Hidden;
            }
        }
    }
}
